import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86155
 * date: 2024-04-10
 * Time: 19:33
 *
 * @author java常用类
 */

public class Test {
    public static void main(String[] args) {
        // 获取今天的日期
        LocalDate today = LocalDate.now();

        // 计算100天后的日期
        LocalDate futureDate = today.plusDays(100);

        // 创建一个日期格式化器，用于格式化为"xxxx年xx月xx日"的形式
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");

        // 格式化日期并打印
        String formattedDate = futureDate.format(formatter);
        System.out.println(formattedDate);
    }
    public static void main3(String[] args) {
        double x = Math.random();
        Random random = new Random();
        int y = random.nextInt(101);  // 注意这里的参数是101，因为nextInt方法的参数是上限（不包含）
        System.out.println(x+" "+y);
        double result = Math.pow(x, y);
        System.out.println(result);
    }
    public static void main2(String[] args) {
        double a = 1.0;
        double b = 5.0;
        double x = Math.max(a,b);
        double y = Math.min(a,b);
        System.out.println(x+" "+y);
        double arr1 =Math.sqrt(x);
        System.out.println(Math.round(arr1));
    }
    public static void main1(String[] args) {
        String str1 = "hello";
        String str2 = "hello";
        String str3 = new String("hello");
        String str4 = new String("hello");
        System.out.println(str1==str2);
        System.out.println(str3==str4);
        System.out.println(str3.equals(str4));
        System.out.println(str1.equals(str2));

        StringBuffer sb1 = new StringBuffer();
        StringBuffer sb2 = new StringBuffer();
        sb1.append("hello");
        sb2.append("hello");
        String str5 = sb1.toString();
        String str6 = sb2.toString();
        System.out.println(sb1==sb2);
        System.out.println(sb1.equals(sb2));
        System.out.println(str5==str6);
        System.out.println(str5.equals(str6));
    }
}
